//
//  WBDemoViewController.swift
//  desunireWeibo
//
//  Created by desunire on 2017/8/25.
//  Copyright © 2017年 desunire. All rights reserved.
//

import UIKit

class WBDemoViewController: WBBaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        title = "第"+"\(navigationController?.childViewControllers.count ?? 0)"+"个"
        //navItem.leftBarButtonItem = UIBarButtonItem.init(title: "", fontSize: 16.0, target: self, action: #selector(goBack), isBack: true)
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    @objc fileprivate func gotoNext(){
        
        let vc = WBDemoViewController()
        
        navigationController?.pushViewController(vc, animated: true)
        
    }
    
    
    @objc fileprivate func goBack(){
        
       navigationController?.popViewController(animated: true)
        
    }

}

extension WBDemoViewController{
    
    override func setTableView() {
         super.setTableView()
        navItem.rightBarButtonItem = UIBarButtonItem.init(title: "下一个", fontSize: 16.0, target: self, action: #selector(gotoNext), isBack: false)
    }
    
//    override func setUI() {
//        super.setUI()
//        //navigationItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", style: .plain, target: self, action: #selector(gotoNext))
//        navItem.rightBarButtonItem = UIBarButtonItem.init(title: "下一个", fontSize: 16.0, target: self, action: #selector(gotoNext), isBack: false)
//    }
    
}
